cmake_minimum_required(VERSION 3.5)
SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")

project(rbdemo)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gtest/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gtest/include/gtest)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gtest/include/gmock)

link_directories(${CMAKE_CURRENT_SOURCE_DIR}/gtest/lib)

FILE(GLOB OPRB_FILES   ${CMAKE_CURRENT_SOURCE_DIR}/src/open_ringbuffer.c
                       ${CMAKE_CURRENT_SOURCE_DIR}/src/oprb_demo.c)

FILE(GLOB OPRB_UT_FILES   ${CMAKE_CURRENT_SOURCE_DIR}/src/open_ringbuffer.c
                          ${CMAKE_CURRENT_SOURCE_DIR}/src/oprb_utest.cpp)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ./)
add_executable(oprbdemo ${OPRB_FILES})
add_definitions(-DOPRB_UTEST)
add_executable(oprbutest ${OPRB_UT_FILES})
target_link_libraries(oprbutest
                      gmock_main
                      gmock
                      gtest_main
                      gtest
                      pthread)
